<template>
  <view class="content">
    <view class="sec-wrap">
      <text>请打分：</text>
      <uni-rate allow-half size="40" :value="value" @change="onChange" />
    </view>
    <view style="padding-left: 100rpx">
      <tui-button shape="circle" width="550rpx" height="80rpx" @click="submit" :disabled="!value"
        >提交
      </tui-button>
    </view>
  </view>
</template>

<script>
export default {
  components: {},
  data() {
    return {
      evId:'',
      value: 0,
    };
  },
  onShareAppMessage() {
    return this.$util.returnShareObj();
  },
  onLoad(options) {
    this.evId=options.evId
  },
  methods: {
    onChange(e) {
      this.value = e.value;
      if (this.value < 1) {
        this.value = 1;
      }
      console.log(e.value);
    },
    submit(){

this.$api.patientEvaluateDoctor({starsNum:this.value,evId:this.evId}).then(res=>{
if(res.code==200){
  this.$util.showSuccessToast("已提交");
                setTimeout(() => {
                  this.$util.backToRefreshPrevPage("evaluateList/index");
                }, 1500);
}
})
    },
  },
};
</script>
<style lang="scss" scoped>
.content {
  .sec-wrap {
    display: flex;
    justify-content: center;
    padding: 100rpx 0;
    align-items: center;
  }
}
</style>
